.class Lcom/trademob/tracking/TMUtility;
.super Ljava/lang/Object;
.source "TMUtility.java"


# instance fields
.field private final myContext:Landroid/content/Context;

.field private final myCryptography:Lcom/trademob/tracking/TMCryptography;

.field private final myDefaultDisplay:Landroid/view/Display;

.field private final myDeviceIdentifier_IMEI:Lcom/trademob/tracking/TMDeviceIdentifier;

.field private final myDeviceIdentifier_Serial:Lcom/trademob/tracking/TMDeviceIdentifier;

.field private final myGpsLocationAccess:Lcom/trademob/tracking/TMGpsLocationAccess;

.field private final myInstallId:Lcom/trademob/tracking/TMInstallId;

.field private final myManifestReader:Lcom/trademob/tracking/TMManifestReader;

.field private final myPreferences:Landroid/content/SharedPreferences;

.field private final myTelephonyManager:Landroid/telephony/TelephonyManager;

.field private final myWifiManager:Landroid/net/wifi/WifiManager;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 4
    .parameter "aContext"

    .prologue
    .line 58
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 60
    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    iput-object v1, p0, Lcom/trademob/tracking/TMUtility;->myContext:Landroid/content/Context;

    .line 61
    iget-object v1, p0, Lcom/trademob/tracking/TMUtility;->myContext:Landroid/content/Context;

    const-string v2, "window"

    invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/WindowManager;

    .line 62
    .local v0, windowManager:Landroid/view/WindowManager;
    invoke-interface {v0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v1

    iput-object v1, p0, Lcom/trademob/tracking/TMUtility;->myDefaultDisplay:Landroid/view/Display;

    .line 63
    iget-object v1, p0, Lcom/trademob/tracking/TMUtility;->myContext:Landroid/content/Context;

    const-string v2, "global"

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v1

    iput-object v1, p0, Lcom/trademob/tracking/TMUtility;->myPreferences:Landroid/content/SharedPreferences;

    .line 64
    new-instance v1, Lcom/trademob/tracking/TMGpsLocationAccess;

    invoke-direct {v1, p1, p0}, Lcom/trademob/tracking/TMGpsLocationAccess;-><init>(Landroid/content/Context;Lcom/trademob/tracking/TMUtility;)V

    iput-object v1, p0, Lcom/trademob/tracking/TMUtility;->myGpsLocationAccess:Lcom/trademob/tracking/TMGpsLocationAccess;

    .line 65
    iget-object v1, p0, Lcom/trademob/tracking/TMUtility;->myContext:Landroid/content/Context;

    const-string v2, "phone"

    invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/telephony/TelephonyManager;

    iput-object v1, p0, Lcom/trademob/tracking/TMUtility;->myTelephonyManager:Landroid/telephony/TelephonyManager;

    .line 66
    new-instance v1, Lcom/trademob/tracking/TMDeviceIdentifier;

    invoke-direct {p0}, Lcom/trademob/tracking/TMUtility;->getIMEI()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Lcom/trademob/tracking/TMDeviceIdentifier;-><init>(Ljava/lang/String;)V

    iput-object v1, p0, Lcom/trademob/tracking/TMUtility;->myDeviceIdentifier_IMEI:Lcom/trademob/tracking/TMDeviceIdentifier;

    .line 67
    new-instance v1, Lcom/trademob/tracking/TMDeviceIdentifier;

    invoke-direct {p0}, Lcom/trademob/tracking/TMUtility;->getDeviceSerial()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Lcom/trademob/tracking/TMDeviceIdentifier;-><init>(Ljava/lang/String;)V

    iput-object v1, p0, Lcom/trademob/tracking/TMUtility;->myDeviceIdentifier_Serial:Lcom/trademob/tracking/TMDeviceIdentifier;

    .line 68
    new-instance v1, Lcom/trademob/tracking/TMManifestReader;

    invoke-direct {v1, p1, p0}, Lcom/trademob/tracking/TMManifestReader;-><init>(Landroid/content/Context;Lcom/trademob/tracking/TMUtility;)V

    iput-object v1, p0, Lcom/trademob/tracking/TMUtility;->myManifestReader:Lcom/trademob/tracking/TMManifestReader;

    .line 69
    new-instance v1, Lcom/trademob/tracking/TMCryptography;

    invoke-direct {v1}, Lcom/trademob/tracking/TMCryptography;-><init>()V

    iput-object v1, p0, Lcom/trademob/tracking/TMUtility;->myCryptography:Lcom/trademob/tracking/TMCryptography;

    .line 70
    iget-object v1, p0, Lcom/trademob/tracking/TMUtility;->myContext:Landroid/content/Context;

    const-string v2, "wifi"

    invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/net/wifi/WifiManager;

    iput-object v1, p0, Lcom/trademob/tracking/TMUtility;->myWifiManager:Landroid/net/wifi/WifiManager;

    .line 71
    new-instance v1, Lcom/trademob/tracking/TMInstallId;

    invoke-direct {v1, p0}, Lcom/trademob/tracking/TMInstallId;-><init>(Lcom/trademob/tracking/TMUtility;)V

    iput-object v1, p0, Lcom/trademob/tracking/TMUtility;->myInstallId:Lcom/trademob/tracking/TMInstallId;

    .line 72
    return-void
.end method

.method private final getDeviceSerial()Ljava/lang/String;
    .locals 7

    .prologue
    .line 238
    const-string v3, "android.permission.READ_PHONE_STATE"

    invoke-virtual {p0, v3}, Lcom/trademob/tracking/TMUtility;->checkPermission(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_0

    .line 242
    :try_start_0
    const-string v3, "android.os.SystemProperties"

    invoke-static {v3}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v2

    .line 243
    .local v2, systemPropertiesClass:Ljava/lang/Class;,"Ljava/lang/Class<*>;"
    const-string v3, "get"

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/Class;

    const/4 v5, 0x0

    const-class v6, Ljava/lang/String;

    aput-object v6, v4, v5

    invoke-virtual {v2, v3, v4}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v1

    .line 244
    .local v1, getMethod:Ljava/lang/reflect/Method;
    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    const-string v5, "ro.serialno"

    aput-object v5, v3, v4

    invoke-virtual {v1, v2, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/String;

    invoke-static {v3}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v3

    .line 254
    .end local v1           #getMethod:Ljava/lang/reflect/Method;
    .end local v2           #systemPropertiesClass:Ljava/lang/Class;,"Ljava/lang/Class<*>;"
    :goto_0
    return-object v3

    .line 246
    :catch_0
    move-exception v0

    .line 248
    .local v0, e:Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 250
    const-string v3, ""

    goto :goto_0

    .line 254
    .end local v0           #e:Ljava/lang/Exception;
    :cond_0
    const-string v3, "0"

    goto :goto_0
.end method

.method private final getIMEI()Ljava/lang/String;
    .locals 2

    .prologue
    .line 214
    const-string v1, "android.permission.READ_PHONE_STATE"

    invoke-virtual {p0, v1}, Lcom/trademob/tracking/TMUtility;->checkPermission(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 218
    :try_start_0
    iget-object v1, p0, Lcom/trademob/tracking/TMUtility;->myTelephonyManager:Landroid/telephony/TelephonyManager;

    invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getDeviceId()Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    .line 228
    :goto_0
    return-object v1

    .line 220
    :catch_0
    move-exception v0

    .line 222
    .local v0, e:Ljava/lang/Exception;
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 224
    const-string v1, ""

    goto :goto_0

    .line 228
    .end local v0           #e:Ljava/lang/Exception;
    :cond_0
    const-string v1, "0"

    goto :goto_0
.end method


# virtual methods
.method public checkPermission(Ljava/lang/String;)Z
    .locals 1
    .parameter "aPermission"

    .prologue
    .line 458
    invoke-virtual {p0, p1}, Lcom/trademob/tracking/TMUtility;->checkPermissionTruly(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method public checkPermissionTruly(Ljava/lang/String;)Z
    .locals 2
    .parameter "aPermission"

    .prologue
    .line 474
    iget-object v1, p0, Lcom/trademob/tracking/TMUtility;->myContext:Landroid/content/Context;

    invoke-virtual {v1, p1}, Landroid/content/Context;->checkCallingOrSelfPermission(Ljava/lang/String;)I

    move-result v0

    .line 475
    .local v0, check:I
    if-nez v0, :cond_0

    const/4 v1, 0x1

    :goto_0
    return v1

    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public displayHeight()I
    .locals 1

    .prologue
    .line 445
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myDefaultDisplay:Landroid/view/Display;

    invoke-virtual {v0}, Landroid/view/Display;->getHeight()I

    move-result v0

    return v0
.end method

.method public displayWidth()I
    .locals 1

    .prologue
    .line 436
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myDefaultDisplay:Landroid/view/Display;

    invoke-virtual {v0}, Landroid/view/Display;->getWidth()I

    move-result v0

    return v0
.end method

.method public getAllMissingPermissions()Ljava/util/Vector;
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Vector",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .prologue
    .line 485
    new-instance v0, Ljava/util/Vector;

    invoke-direct {v0}, Ljava/util/Vector;-><init>()V

    .line 486
    .local v0, result:Ljava/util/Vector;,"Ljava/util/Vector<Ljava/lang/String;>;"
    const-string v1, "android.permission.INTERNET"

    invoke-virtual {p0, v1}, Lcom/trademob/tracking/TMUtility;->checkPermissionTruly(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 488
    const-string v1, "android.permission.INTERNET"

    invoke-virtual {v0, v1}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    .line 490
    :cond_0
    const-string v1, "android.permission.READ_PHONE_STATE"

    invoke-virtual {p0, v1}, Lcom/trademob/tracking/TMUtility;->checkPermissionTruly(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_1

    .line 492
    const-string v1, "android.permission.READ_PHONE_STATE"

    invoke-virtual {v0, v1}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    .line 494
    :cond_1
    const-string v1, "android.permission.ACCESS_WIFI_STATE"

    invoke-virtual {p0, v1}, Lcom/trademob/tracking/TMUtility;->checkPermissionTruly(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_2

    .line 496
    const-string v1, "android.permission.ACCESS_WIFI_STATE"

    invoke-virtual {v0, v1}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    .line 498
    :cond_2
    return-object v0
.end method

.method public final getAppName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 205
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myManifestReader:Lcom/trademob/tracking/TMManifestReader;

    invoke-virtual {v0}, Lcom/trademob/tracking/TMManifestReader;->getApplicationName()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final getAppVersion()Ljava/lang/String;
    .locals 1

    .prologue
    .line 196
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myManifestReader:Lcom/trademob/tracking/TMManifestReader;

    invoke-virtual {v0}, Lcom/trademob/tracking/TMManifestReader;->getAppVersion()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final getBundleIdentifier()Ljava/lang/String;
    .locals 1

    .prologue
    .line 187
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myManifestReader:Lcom/trademob/tracking/TMManifestReader;

    invoke-virtual {v0}, Lcom/trademob/tracking/TMManifestReader;->getPackageName()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final getDeviceModel()Ljava/lang/String;
    .locals 1

    .prologue
    .line 264
    sget-object v0, Landroid/os/Build;->MODEL:Ljava/lang/String;

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getEventCounterForKey(Ljava/lang/String;)I
    .locals 2
    .parameter "aKey"

    .prologue
    .line 567
    const/4 v1, 0x1

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    .line 568
    .local v0, value:Ljava/lang/Integer;
    invoke-virtual {p0, p1}, Lcom/trademob/tracking/TMUtility;->isStored(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 570
    invoke-virtual {p0, p1}, Lcom/trademob/tracking/TMUtility;->restore(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v1

    add-int/lit8 v1, v1, 0x1

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    .line 572
    :cond_0
    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0, p1, v1}, Lcom/trademob/tracking/TMUtility;->store(Ljava/lang/String;Ljava/lang/String;)V

    .line 573
    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v1

    return v1
.end method

.method public getInstallId()Ljava/lang/String;
    .locals 1

    .prologue
    .line 537
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myInstallId:Lcom/trademob/tracking/TMInstallId;

    invoke-virtual {v0}, Lcom/trademob/tracking/TMInstallId;->getinstallId()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getInstallIdIsNew()Ljava/lang/String;
    .locals 1

    .prologue
    .line 546
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myInstallId:Lcom/trademob/tracking/TMInstallId;

    invoke-virtual {v0}, Lcom/trademob/tracking/TMInstallId;->getInstallIsNew()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final getMD5IMEI()Ljava/lang/String;
    .locals 1

    .prologue
    .line 142
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myDeviceIdentifier_IMEI:Lcom/trademob/tracking/TMDeviceIdentifier;

    invoke-virtual {v0}, Lcom/trademob/tracking/TMDeviceIdentifier;->MD5()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final getMD5Serial()Ljava/lang/String;
    .locals 1

    .prologue
    .line 169
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myDeviceIdentifier_Serial:Lcom/trademob/tracking/TMDeviceIdentifier;

    invoke-virtual {v0}, Lcom/trademob/tracking/TMDeviceIdentifier;->MD5()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final getNanotime()J
    .locals 4

    .prologue
    .line 80
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    const-wide/32 v2, 0xf4240

    mul-long/2addr v0, v2

    return-wide v0
.end method

.method public final getOSVersion()Ljava/lang/String;
    .locals 1

    .prologue
    .line 273
    sget-object v0, Landroid/os/Build$VERSION;->RELEASE:Ljava/lang/String;

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getSDKVersion()Ljava/lang/String;
    .locals 1

    .prologue
    .line 557
    const-string v0, "1.4.0p"

    return-object v0
.end method

.method public final getSHA1IMEI()Ljava/lang/String;
    .locals 1

    .prologue
    .line 151
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myDeviceIdentifier_IMEI:Lcom/trademob/tracking/TMDeviceIdentifier;

    invoke-virtual {v0}, Lcom/trademob/tracking/TMDeviceIdentifier;->SHA1()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final getSHA1Serial()Ljava/lang/String;
    .locals 1

    .prologue
    .line 178
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myDeviceIdentifier_Serial:Lcom/trademob/tracking/TMDeviceIdentifier;

    invoke-virtual {v0}, Lcom/trademob/tracking/TMDeviceIdentifier;->SHA1()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final getShortIMEI()Ljava/lang/String;
    .locals 1

    .prologue
    .line 133
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myDeviceIdentifier_IMEI:Lcom/trademob/tracking/TMDeviceIdentifier;

    invoke-virtual {v0}, Lcom/trademob/tracking/TMDeviceIdentifier;->MD5_24()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final getShortSerial()Ljava/lang/String;
    .locals 1

    .prologue
    .line 160
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myDeviceIdentifier_Serial:Lcom/trademob/tracking/TMDeviceIdentifier;

    invoke-virtual {v0}, Lcom/trademob/tracking/TMDeviceIdentifier;->MD5_24()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final getTimeZone()Ljava/lang/String;
    .locals 6

    .prologue
    .line 110
    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v0

    .line 112
    .local v0, calendar:Ljava/util/Calendar;
    const/16 v4, 0xf

    invoke-virtual {v0, v4}, Ljava/util/Calendar;->get(I)I

    move-result v4

    const v5, 0x36ee80

    div-int/2addr v4, v5

    int-to-float v4, v4

    invoke-static {v4}, Ljava/lang/Math;->round(F)I

    move-result v4

    int-to-long v1, v4

    .line 113
    .local v1, modifier:J
    const-string v3, "UTC"

    .line 115
    .local v3, result:Ljava/lang/String;
    const-wide/16 v4, 0x0

    cmp-long v4, v1, v4

    if-gez v4, :cond_0

    .line 117
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v4, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    .line 122
    :goto_0
    return-object v4

    :cond_0
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v5, "+"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    goto :goto_0
.end method

.method public final getWifiStatus()Ljava/lang/String;
    .locals 1

    .prologue
    .line 89
    const-string v0, "android.permission.ACCESS_WIFI_STATE"

    invoke-virtual {p0, v0}, Lcom/trademob/tracking/TMUtility;->checkPermission(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 91
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myWifiManager:Landroid/net/wifi/WifiManager;

    invoke-virtual {v0}, Landroid/net/wifi/WifiManager;->isWifiEnabled()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 93
    const-string v0, "enabled"

    .line 100
    :goto_0
    return-object v0

    .line 97
    :cond_0
    const-string v0, "disabled"

    goto :goto_0

    .line 100
    :cond_1
    const-string v0, "0"

    goto :goto_0
.end method

.method public isStored(Ljava/lang/String;)Z
    .locals 1
    .parameter "aKey"

    .prologue
    .line 362
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myPreferences:Landroid/content/SharedPreferences;

    invoke-interface {v0, p1}, Landroid/content/SharedPreferences;->contains(Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method public final lastKnownLocation()Lcom/trademob/tracking/TMLocationData;
    .locals 6

    .prologue
    const-wide/16 v2, 0x0

    .line 292
    iget-object v1, p0, Lcom/trademob/tracking/TMUtility;->myGpsLocationAccess:Lcom/trademob/tracking/TMGpsLocationAccess;

    invoke-virtual {v1}, Lcom/trademob/tracking/TMGpsLocationAccess;->getLocation()Landroid/location/Location;

    move-result-object v0

    .line 293
    .local v0, location:Landroid/location/Location;
    if-nez v0, :cond_0

    new-instance v1, Lcom/trademob/tracking/TMLocationData;

    invoke-direct {v1, v2, v3, v2, v3}, Lcom/trademob/tracking/TMLocationData;-><init>(DD)V

    .line 294
    :goto_0
    return-object v1

    :cond_0
    new-instance v1, Lcom/trademob/tracking/TMLocationData;

    invoke-virtual {v0}, Landroid/location/Location;->getLongitude()D

    move-result-wide v2

    invoke-virtual {v0}, Landroid/location/Location;->getLatitude()D

    move-result-wide v4

    invoke-direct {v1, v2, v3, v4, v5}, Lcom/trademob/tracking/TMLocationData;-><init>(DD)V

    goto :goto_0
.end method

.method public permissionLogger()V
    .locals 3

    .prologue
    .line 507
    invoke-virtual {p0}, Lcom/trademob/tracking/TMUtility;->getAllMissingPermissions()Ljava/util/Vector;

    move-result-object v0

    .line 511
    .local v0, missingPermissions:Ljava/util/Vector;,"Ljava/util/Vector<Ljava/lang/String;>;"
    const-string v1, "android.permission.INTERNET"

    invoke-virtual {v0, v1}, Ljava/util/Vector;->contains(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 513
    const-string v1, "TMUniversalTrackingSDK"

    const-string v2, "Trademob Tracking SDK needs android.permission.INTERNET to operate properly."

    invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 514
    const-string v1, "TMUniversalTrackingSDK"

    const-string v2, "Please add the needed permission(s) to your AndroidManifest.xml"

    invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 529
    :cond_0
    return-void
.end method

.method public restore(Ljava/lang/String;)Ljava/lang/String;
    .locals 2
    .parameter "aKey"

    .prologue
    .line 382
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myPreferences:Landroid/content/SharedPreferences;

    const/4 v1, 0x0

    invoke-interface {v0, p1, v1}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public restoreStringVector(Ljava/lang/String;)Ljava/util/Vector;
    .locals 5
    .parameter "aKey"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/Vector",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .prologue
    .line 415
    invoke-virtual {p0, p1}, Lcom/trademob/tracking/TMUtility;->restore(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 416
    .local v1, fromDisk:Ljava/lang/String;
    if-eqz v1, :cond_1

    const-string v4, ""

    if-eq v1, v4, :cond_1

    .line 419
    const-string v4, " "

    invoke-virtual {v1, v4}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v0

    .line 420
    .local v0, arr:[Ljava/lang/String;
    new-instance v3, Ljava/util/Vector;

    invoke-direct {v3}, Ljava/util/Vector;-><init>()V

    .line 421
    .local v3, result:Ljava/util/Vector;,"Ljava/util/Vector<Ljava/lang/String;>;"
    const/4 v2, 0x0

    .local v2, i:I
    :goto_0
    array-length v4, v0

    if-lt v2, v4, :cond_0

    .line 427
    .end local v0           #arr:[Ljava/lang/String;
    .end local v2           #i:I
    .end local v3           #result:Ljava/util/Vector;,"Ljava/util/Vector<Ljava/lang/String;>;"
    :goto_1
    return-object v3

    .line 423
    .restart local v0       #arr:[Ljava/lang/String;
    .restart local v2       #i:I
    .restart local v3       #result:Ljava/util/Vector;,"Ljava/util/Vector<Ljava/lang/String;>;"
    :cond_0
    aget-object v4, v0, v2

    invoke-virtual {v3, v4}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    .line 421
    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    .line 427
    .end local v0           #arr:[Ljava/lang/String;
    .end local v2           #i:I
    .end local v3           #result:Ljava/util/Vector;,"Ljava/util/Vector<Ljava/lang/String;>;"
    :cond_1
    new-instance v3, Ljava/util/Vector;

    invoke-direct {v3}, Ljava/util/Vector;-><init>()V

    goto :goto_1
.end method

.method public final retrieveCarrier()Ljava/lang/String;
    .locals 2

    .prologue
    .line 304
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myTelephonyManager:Landroid/telephony/TelephonyManager;

    invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getSimState()I

    move-result v0

    const/4 v1, 0x5

    if-ne v0, v1, :cond_0

    .line 306
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myTelephonyManager:Landroid/telephony/TelephonyManager;

    invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getSimOperatorName()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 308
    :goto_0
    return-object v0

    :cond_0
    const-string v0, ""

    goto :goto_0
.end method

.method public final retrieveMobileNetworkCode()Ljava/lang/String;
    .locals 1

    .prologue
    .line 330
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myTelephonyManager:Landroid/telephony/TelephonyManager;

    invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getNetworkOperator()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public final retrieveSimIdMD5Hash()Ljava/lang/String;
    .locals 3

    .prologue
    .line 340
    const-string v0, "android.permission.READ_PHONE_STATE"

    invoke-virtual {p0, v0}, Lcom/trademob/tracking/TMUtility;->checkPermission(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 343
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myTelephonyManager:Landroid/telephony/TelephonyManager;

    invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getSimState()I

    move-result v0

    const/4 v1, 0x5

    if-ne v0, v1, :cond_0

    .line 345
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myCryptography:Lcom/trademob/tracking/TMCryptography;

    iget-object v1, p0, Lcom/trademob/tracking/TMUtility;->myTelephonyManager:Landroid/telephony/TelephonyManager;

    invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getSimSerialNumber()Ljava/lang/String;

    move-result-object v1

    const-string v2, "MD5"

    invoke-virtual {v0, v1, v2}, Lcom/trademob/tracking/TMCryptography;->encrypt(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 351
    :goto_0
    return-object v0

    .line 347
    :cond_0
    const-string v0, ""

    goto :goto_0

    .line 351
    :cond_1
    const-string v0, "0"

    goto :goto_0
.end method

.method public final retrieveSimNetworkCode()Ljava/lang/String;
    .locals 2

    .prologue
    .line 317
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myTelephonyManager:Landroid/telephony/TelephonyManager;

    invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getSimState()I

    move-result v0

    const/4 v1, 0x5

    if-ne v0, v1, :cond_0

    .line 319
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myTelephonyManager:Landroid/telephony/TelephonyManager;

    invoke-virtual {v0}, Landroid/telephony/TelephonyManager;->getSimOperator()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 321
    :goto_0
    return-object v0

    :cond_0
    const-string v0, ""

    goto :goto_0
.end method

.method public store(Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .parameter "aKey"
    .parameter "aValue"

    .prologue
    .line 372
    iget-object v0, p0, Lcom/trademob/tracking/TMUtility;->myPreferences:Landroid/content/SharedPreferences;

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0, p1, p2}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 373
    return-void
.end method

.method public storeStringVector(Ljava/lang/String;Ljava/util/Vector;)V
    .locals 4
    .parameter "aKey"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/util/Vector",
            "<",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 393
    .local p2, aVector:Ljava/util/Vector;,"Ljava/util/Vector<Ljava/lang/String;>;"
    invoke-virtual {p2}, Ljava/util/Vector;->size()I

    move-result v2

    if-lez v2, :cond_1

    .line 395
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    .line 396
    .local v0, builder:Ljava/lang/StringBuilder;
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    invoke-virtual {p2}, Ljava/util/Vector;->size()I

    move-result v2

    add-int/lit8 v2, v2, -0x1

    if-lt v1, v2, :cond_0

    .line 400
    invoke-virtual {p2}, Ljava/util/Vector;->lastElement()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 401
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p0, p1, v2}, Lcom/trademob/tracking/TMUtility;->store(Ljava/lang/String;Ljava/lang/String;)V

    .line 406
    .end local v0           #builder:Ljava/lang/StringBuilder;
    .end local v1           #i:I
    :goto_1
    return-void

    .line 398
    .restart local v0       #builder:Ljava/lang/StringBuilder;
    .restart local v1       #i:I
    :cond_0
    invoke-virtual {p2, v1}, Ljava/util/Vector;->elementAt(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, " "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 396
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 405
    .end local v0           #builder:Ljava/lang/StringBuilder;
    .end local v1           #i:I
    :cond_1
    const-string v2, ""

    invoke-virtual {p0, p1, v2}, Lcom/trademob/tracking/TMUtility;->store(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1
.end method

.method public userDefaultLocale()Lcom/trademob/tracking/TMLocaleData;
    .locals 4

    .prologue
    .line 282
    invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;

    move-result-object v0

    .line 283
    .local v0, locale:Ljava/util/Locale;
    new-instance v1, Lcom/trademob/tracking/TMLocaleData;

    invoke-virtual {v0}, Ljava/util/Locale;->getCountry()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0}, Ljava/util/Locale;->getLanguage()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v1, v2, v3}, Lcom/trademob/tracking/TMLocaleData;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    return-object v1
.end method
